﻿using System.Collections.Generic;
using Foreglance.MVP.Delegates;

namespace Foreglance.MVP.Presenters
{
    public interface IEntityViewPresenter<TEntity> : IViewPresenter
    {
        event ObjectListEventHandler<TEntity> OnRefreshView;
        event ObjectListEventHandler<TEntity> OnEntitiesSelectionChanged;
        void AddEntity();
        void EditEntity();
        void DeleteEntities();
        bool ValidateAddingEnabled(List<TEntity> entities);
        bool ValidateEditingEnabled(List<TEntity> entities);
        bool ValidateDeletingEnabled(List<TEntity> entities);
        void RefreshView();
        void SaveEntity(TEntity entity);
        void SelectEntity(TEntity entity);
        void UnselectEntity(TEntity entity);
        void SelectEntities(List<TEntity> entities);
        event ObjectListEventHandler<TEntity> OnEntitiesAdded;
        event ObjectListEventHandler<TEntity> OnEntitiesEdited;
        event ObjectListEventHandler<TEntity> OnEntitiesDeleted;
    }
}